<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title> V2商户后台- 主页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <link rel="shortcut icon" href="__PUBLIC__/admin/favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <!--//聊天-->
    <link href=__PUBLIC__/static/css/app.53a592f835b0ed9442fb2a8900b142b5.css rel=stylesheet>
</head>

<style>
    .layui-layer-loading0{
        left:180%
    }
</style>
<!-- <include file="Admin@Index:cache" /> -->
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">

<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu" style="margin-bottom: 3rem">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="__MODULE__/Index/home">
                                <span class="clear">
                                    <span class="block m-t-xs" style="font-size:20px;">
                                        <i class="fa fa-area-chart"></i>
                                        <strong class="font-bold">商户后台</strong>
                                    </span>
                                </span>
                                <span class="clear">
                                    <span class="block m-t-xs" style="font-size:20px;">
                                        <strong style="font-size: 13px" class="font-bold">商户号：<?php echo $_SESSION['shop_identifier'];?></strong>
                                    </span>
                                </span>
                        </a>
                    </div>
                    <div class="logo-element">后台
                    </div>
                </li>
                <li>
                    <a class="J_menuItem" href="__MODULE__/Index/home">
                        <i class="fa fa-home"></i>
                        <span class="nav-label">主页</span>
                    </a>
                </li>
                <if condition="$_SESSION['rid'] eq '99'">
                    <li>
                        <a href="javascript:void(0);"><i class="fa fa-edit"></i> <span class="nav-label">商户管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a class="J_menuItem" href="__MODULE__/Admin/role_list" >角色列表</a>
                            </li>

                        </ul>
                    </li>
                </if>
                <foreach name="top_power" item="top">
                <li>
                    <a href="#">
                        <switch name="top.actionname">
                            <case value="admin"> <i class="fa fa-user"></i> </case>
                            <case value="User"> <i class="fa fa-user"></i> </case>
                            <!--<case value="whole"> <i class="fa fa-shopping-cart"></i> </case>-->
                            <case value="finance">  <i class="fa fa-dollar"></i></case>
                            <case value="Statistics"> <i class="glyphicon glyphicon-calendar"></i> </case>
                            <case value="logs"> <i class="fa fa-leanpub"></i> </case>
                            <case value="Message"> <i class="fa fa-volume-up"></i> </case>
                            <case value="systems"> <i class="fa fa-cog"></i> </case>
                            <case value="orders"> <i class="fa fa-sticky-note-o"></i> </case>
                            <case value="merchant"> <i class="fa fa-medium"></i> </case>
                            <!--<case value="risk"> <i class="fa fa-asterisk"></i> </case>-->
                            <!--<case value="statistics"> <i class="glyphicon glyphicon-yen"></i> </case>-->
                            <!--<case value="work"> <i class="glyphicon glyphicon-list-alt"></i> </case>-->
                            <!--<case value="cpa"> <i class="fa fa-bank"></i> </case>-->
                            <!--<case value="activity"> <i class="glyphicon glyphicon-leaf"></i> </case>-->
                            <case value="urge"> <i class="fa fa-google-wallet"></i> </case>
                            <!--<case value="refund"> <i class="fa fa-gg"></i> </case>-->
                            <case value="CheckManager"> <i class="fa fa-edit"></i> </case>
                            <case value="operate">  <i class="fa fa-bank"></i> </case>
                            <!--<case value="product"> <i class="fa fa-shopping-cart"></i> </case>-->
                            <case value="check"> <i class="fa fa-check"></i> </case>
                            <case value="LoanManage"> <i class="fa fa-opera"></i> </case>
                            <case value="Finance"> <i class="glyphicon glyphicon-yen"></i> </case>
                            <!--<case value="chat"> <i class="glyphicon glyphicon-phone-alt"></i> </case>-->
                            <!--<case value="Cooperation"> <i class="fa fa-bank"></i> </case>-->
                        </switch>
                        <span class="nav-label"><{$top.name}></span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="nav nav-second-level">
                        <foreach name="next_power" item="next">
                        <if condition="$next['pid'] eq $top['id']">
                        <li>
                            <!--<?php if($next['actionname']!='role_list'){ ?>-->
                            <if condition="$next['actionname'] eq 'data_statistics' || $next['actionname'] eq 'voucher_statistics'">
                            <a class="J_menuItem" onclick="statistics('__MODULE__/<{$top.actionname}>/<{$next.actionname}>')"><{$next.name}></a>
                            <else/>
                                <a class="J_menuItem" href='__MODULE__/<{$top.actionname}>/<{$next.actionname}>'><{$next.name}></a>
                            </if>
                            <!--<?php }else{ ?>-->
                            <!--<?php if($_SESSION['rid']=='99'){ ?>-->
                            <!--<a class="J_menuItem" href='__MODULE__/<{$top.actionname}>/<{$next.actionname}>'><{$next.name}></a>-->
                            <!--<?php } ?>-->

                            <!--<?php }?>-->
                        </li>
                        </if>
                        </foreach>

                    </ul>
                </li>
                </foreach>

                <if condition="$_SESSION['rid'] eq '99'">
                <li>
                    <a href="javascript:void(0);"><i class="fa fa-edit"></i> <span class="nav-label">权限管理</span><span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level">
                        <li><a class="J_menuItem" href="__MODULE__/Power/power" >添加权限</a>
                        </li>
                        <li><a class="J_menuItem" href="__MODULE__/Power/power_list" >权限列表</a>
                        </li>
                    </ul>
                </li>
                </if>
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->

    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-info " href="#"><i
                        class="fa fa-bars"></i> </a>
                    <!--<form role="search" class="navbar-form-custom" method="post" action="search_results.html">-->
                        <!--<div class="form-group">-->
                            <!--<input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search"-->
                                   <!--id="top-search">-->
                        <!--</div>-->
                    <!--</form>-->
                </div>
                <ul class="nav navbar-top-links navbar-right">
                    <!--<if condition="$_SESSION['rid'] eq '99'"><a class="btn btn-danger " href="javascript:;" onclick="" style="margin-right: 16rem" >测试</a></if>-->

                    <a class="btn btn-success " href="javascript:;" onclick="refresh()" style="margin-right: 12rem" >刷新</a>
                    <li class="dropdown" style="top:10px;font-size: 1.5rem;right: 10rem"><span id="w_money"><{$merchant_msg.withhold_balance}></span><br><strong>代扣余额</strong></li>
                    <li class="dropdown" style="top:10px;font-size: 1.5rem;right: 8rem"><span id="m_money"><{$merchant_msg.msg_balance}></span><br><strong>信息余额</strong></li>
                    <li class="dropdown" style="top:10px;font-size: 1.5rem;right: 4rem"><span id="r_money"><{$merchant_msg.aut_balance}></span><br><strong>认证余额</strong></li>
                    <a class="btn btn-info "  href="javascript:;" onclick="recharge()"  >充值</a>

                    <li class="dropdown" id="setd">
                        <a class="dropdown-toggle count-info" id="set" data-toggle="dropdown" href="#">
                            <i class="fa fa-cog"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-alerts">
                            <li class="divider"></li>
                            <li>
                                <a >
                                    <div>
                                        <i class="fa fa-qq fa-fw"></i> <?php echo $_SESSION['name'];?>
                                        <br/>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<?php echo $_SESSION['login_time'];?>
                                        <!--<span class="pull-right text-muted small"></span>-->
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <!--<li>-->
                                <!--<a class="J_menuItem " onclick="setup()" href="__MODULE__/Market/service_market" >-->
                                    <!--<div>-->
                                        <!--<i class="fa fa-bank"></i> 服务市场-->
                                    <!--</div>-->
                                <!--</a>-->
                            <!--</li>-->
                            <!-- <li>
                                <a class="J_menuItem " onclick="bind_bank()">
                                    <div>
                                        <i class="fa fa-bank"></i> 银行卡
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li> -->
                            <li>
                                <a href="javascript:;" onclick="edit_pwd()">
                                    <div>
                                        <i class="fa fa-refresh"></i> 修改密码
                                        <!--<span class="pull-right text-muted small">12分钟钱</span>-->
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <a href="__MODULE__/Login/logout" >
                                    <div>
                                        <i class="fa fa-power-off"></i> 退出登录
                                        <!--<span class="pull-right text-muted small">12分钟钱</span>-->
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe id="J_iframe" width="100%" height="100%" src="__MODULE__/Index/home" frameborder="0" data-id="index_v1.html" seamless></iframe>
        </div>
    </div>
    <!--右侧部分结束-->
</div>
<if condition="$is_kf eq 1">
    <div id=app></div>
    <!--//聊天-->
    <script type=text/javascript src=__PUBLIC__/static/js/manifest.2ae2e69a05c33dfc65f8.js></script>
    <script type=text/javascript src=__PUBLIC__/static/js/vendor.a243f4f90bfb36bbc571.js></script>
    <script type=text/javascript src=__PUBLIC__/static/js/app.24c9f8e034b3d029da07.js></script>
    <script src=http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js></script>
</if>
<!-- 全局js -->
<script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__PUBLIC__/admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__PUBLIC__/admin/js/plugins/layer/layer.min.js"></script>
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/hAdmin.js?v=4.1.0"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/index.js"></script>

<!-- 第三方插件 -->
<script>
    //过期后登录页面跳转
    function url_change(obj) {
        var url = obj.contentWindow.location.href;
        if (url.indexOf('login') != -1) {
            window.location.href = "__MODULE__/Login/login.html";
        }
    }

    function setup() {
        $("#set").attr("aria-expanded",false);
        $("#setd").removeClass("open");
    }

    //充值
    function recharge() {
        // var iframe = $("#J_iframe");
        // iframe.attr('src', "__MODULE__/Finance/recharge");
         	url='__MODULE__/Finance/recharge';
        // var iframe = $("#J_iframe");
        // iframe.attr('src', "__MODULE__/Login/modify");
           layer.open({
              type: 2,
              title: '充值',
              shadeClose: true,
              shade: false,
              maxmin: true, //开启最大化最小化按钮
              area: ['500px', '500px'],
              content: url
        });
    }


    //银行卡
    function bind_bank() {
    	url='__MODULE__/Finance/bind_bank';
        // var iframe = $("#J_iframe");
        // iframe.attr('src', "__MODULE__/Login/modify");
           layer.open({
              type: 2,
              title: '银行卡',
              shadeClose: true,
              shade: false,
              maxmin: true, //开启最大化最小化按钮
              area: ['500px', '500px'],
              content: url
        });
    }

    //修改密码
    function edit_pwd() {
        url='__MODULE__/Login/modify';
        // var iframe = $("#J_iframe");
        // iframe.attr('src', "__MODULE__/Login/modify");
           layer.open({
              type: 2,
              title: '修改密码',
              shadeClose: true,
              shade: false,
              maxmin: true, //开启最大化最小化按钮
              area: ['500px', '500px'],
              content: url
        });
    }

    function statistics(url){
        layer.load(0);
        iframe = $("#J_iframe");
         iframe.attr('src', url);
    }
    function close(){
        layer.closeAll();
    }

    function refresh(){
        layer.load(0);
        var frame = window.parent.document.getElementById("J_iframe");
        var path = frame.getAttribute("src");
        frame.setAttribute("src", path);

        //余额也刷新

        $.post('__MODULE__/Index/get_balance',{},function (data) {

            if(data.code=='1001'){
                var obj=data.data;
                document.getElementById("w_money").innerText=obj.withhold_balance;
                document.getElementById("r_money").innerText=obj.aut_balance;
                document.getElementById("m_money").innerText=obj.msg_balance;

//              console.log(data);
            }

        });


        layer.closeAll('loading');



    }


</script>
</body>
</html>
